using System;
using System.Data;
using Utils;
using Utils.DatabaseUtils;


namespace QLCG.DAO
{
public class tblChuyenMonChuyenGiaUI
{ 
	private int idChuyenMonChuyenGia;
	public int IdChuyenMonChuyenGia
	{
		get { return idChuyenMonChuyenGia;}
		set { idChuyenMonChuyenGia = value;}
	}

	private int idChuyenGia;
	public int IdChuyenGia
	{
		get { return idChuyenGia;}
		set { idChuyenGia = value;}
	}

	private int idChuyenMon;
	public int IdChuyenMon
	{
		get { return idChuyenMon;}
		set { idChuyenMon = value;}
	}

	public tblChuyenMonChuyenGiaUI() {}

	public tblChuyenMonChuyenGiaUI(int idChuyenMonChuyenGia, int idChuyenGia, int idChuyenMon)
	 {
		this.idChuyenMonChuyenGia = idChuyenMonChuyenGia;
 		this.idChuyenGia = idChuyenGia;
 		this.idChuyenMon = idChuyenMon;
 	}

	public int Add(int idChuyenGia, int idChuyenMon)
	{
		try
		{
			int result = SqlHelper.ExecuteNonQuery(Common.Conn,"tblChuyenMonChuyenGia_Add",idChuyenGia,idChuyenMon);
			return result;
		}
		catch(Exception e) {return -1; }
	}

	public int Update(int idChuyenMonChuyenGia, int idChuyenGia, int idChuyenMon)
	{
		try
		{
			int result = SqlHelper.ExecuteNonQuery(Common.Conn,"tblChuyenMonChuyenGia_Update",idChuyenMonChuyenGia,idChuyenGia,idChuyenMon);
			return result;
		}
		catch(Exception e) {return -1; }
	}

	public int Delete(int idChuyenMonChuyenGia)
	{
		try
		{
			int result = SqlHelper.ExecuteNonQuery(Common.Conn,"tblChuyenMonChuyenGia_Delete",idChuyenMonChuyenGia);
			return result;
		}
		catch(Exception e) {return -1; }
	}

	public int DeleteAll()
	{
		try
		{
			int result = SqlHelper.ExecuteNonQuery(Common.Conn,"tblChuyenMonChuyenGia_DeleteAll");
			return result;
		}
		catch(Exception e) {return -1; }
	}

	public DataSet Get(int idChuyenMonChuyenGia)
	{
		try
		{
			DataSet result = SqlHelper.ExecuteDataset(Common.Conn,"tblChuyenMonChuyenGia_Get",idChuyenMonChuyenGia);
			return result;
		}
		catch(Exception e) {return null; }
	}

	public DataSet GetAll()
	{
		try
		{
			DataSet result = SqlHelper.ExecuteDataset(Common.Conn,"tblChuyenMonChuyenGia_GetAll");
			return result;
		}
		catch(Exception e) {return null; }
	}

	public DataSet GetByIdChuyenGia(int idChuyenGia)
	{
		try
		{
			DataSet result = SqlHelper.ExecuteDataset(Common.Conn,"tblChuyenMonChuyenGia_GetByIdChuyenGia",idChuyenGia);
			return result;
		}
		catch(Exception e) {return null; }
	}

	public DataSet GetByIdChuyenMon(int idChuyenMon)
	{
		try
		{
			DataSet result = SqlHelper.ExecuteDataset(Common.Conn,"tblChuyenMonChuyenGia_GetByIdChuyenMon",idChuyenMon);
			return result;
		}
		catch(Exception e) {return null; }
	}

} 
}
